tmem: check the return value of copy to guest
authorBob Liu <lliubbo@gmail.com>
Thu, 12 Dec 2013 11:05:15 +0000 (19:05 +0800)
committerJan Beulich <jbeulich@suse.com>
Wed, 8 Jan 2014 07:55:38 +0000 (08:55 +0100)
commitc8e6ce764fd0f84cb345b8dc18508e313099e61e
tree188336c773b2683f5db2f976246163857020eacb
parent5e173a02c6220442b93a8e36a67305d705ff6467
tmem: check the return value of copy to guest

Use function copy_to_guest_offset/copy_to_guest directly and check their return
value.

This also fixes CID 1132754, and 1132755:
"Unchecked return value
If the function returns an error value, the error value may be mistaken for a
normal value.  In tmem_copy_to_client_buf_offset: Value returned from a function
is not checked for errors before being used (CWE-252)"

And CID 105512510551261055127105512810551291055130
"Unchecked return value
If the function returns an error value, the error value may be mistaken for a
normal value.  In <functions changed>: Value returned from a function is not
checked for errors before being used (CWE-252)"

Signed-off-by: Bob Liu <bob.liu@oracle.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
xen/common/tmem.c
xen/include/xen/tmem_xen.h